<template>
  <div v-if="visible" class="tips-dialog">
    <div class="tips-mask"></div>
    <div class="tips-content">
      <div class="dialog-content">
        <img class="buy-error" src="@/assets/images/tips_popups.png" alt="" />
      </div>
      <img class="dialog-close" src="@/assets/images/tips_close.png" alt="" @click="closeDialog" />
      <img class="dialog-btn" src="@/assets/images/tips_btn.png" @click="closeDialog" />
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const visible = ref(false)
const openDialog = () => {
  visible.value = true
}
const closeDialog = () => {
  visible.value = false
}
defineExpose({
  openDialog,
  closeDialog,
})
</script>
<style scoped lang="scss">
.tips-dialog {
  position: relative;
  z-index: 9999;
}
.tips-mask {
  width: 100vw;
  height: 100vh;
  background: #000;
  opacity: 0.8;
  position: fixed;
  left: 0;
  top: 0;
}
.tips-content {
  position: fixed;
  z-index: 999;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 310px;
  height: 182px;
  background: #fff;
  border-radius: 21px;
}
.dialog-content {
  position: relative;
  .buy-error {
    width: 100%;
    height: 100%;
  }
}
.dialog-btn {
  position: absolute;
  left: 50%;
  bottom: -57px;
  transform: translateX(-50%);
  width: 180px;
  height: 45px;
}
.dialog-close {
  position: absolute;
  right: 10px;
  top: -34px;
  width: 24px;
  height: 24px;
  z-index: 99;
}
</style>
